package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class TravelQueryObject extends QueryObject {
    private Integer state = -1;
    private Long destId = -1L;
    private Long travelId;
    //前台传过来的参数
    private Integer orderType = 1;
    private Integer travelTimeType = -1;
    private Integer perExpendType = -1;
    private Integer dayType = -1;



    //翻译
    public TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PER_EXPEND.get(perExpendType);
    }

    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }

    public String getOrderBy(){
        return orderType.equals(1) ? "releaseTime desc" : "viewnum desc";
    }
}
